/* 录入题目到数据库 */
export const useSaveQuestion = (enterObj, className, gradeDesc, gid, uid) => {
  wx.cloud.callFunction({
    name: 'reqQuestionAPI',
    data: {
      scene: 'SAVE_QUESTION',
      enterObj,
      className,
      gradeDesc,
      gid,
      uid
    }
  }).then(res => {
    console.log(res);
    // 录入成功
    wx.showToast({
      title: '录入题目成功',
      icon: 'success',
      duration: 2000,
      success: () => {
        // 跳转到category页面
        setTimeout(() => {
          wx.switchTab({
            url: '../../../pages/category/category',
          })
        }, 500)
      }
    })
  })
};